/*
 * CGameStateMachine.h
 *
 *  Created on: Aug 31, 2011
 *      Author: welcome
 */

#ifndef CGAMESTATEMACHINE_H_
#define CGAMESTATEMACHINE_H_

#include <KD/kd.h>
#include <ac3dui/ac.h>
#include <set>
#include <StateMachine/CStateCollection.h>
#include <StateMachine/CStateMachineDelegate.h>

using namespace std;

namespace GGEngine {

class CGameStateMachine: public acObject {

public:
	CGameStateMachine(CStateMachineDelegate* delegate);

	virtual ~CGameStateMachine();

	KDboolean activateStateWithID(int stateID);

	CState*  getStateFromID(int stateID);

	void      setDelegate(CStateMachineDelegate* delegate);

	void      updateWithEvents(set<int> events);

	KDboolean activateFirstStateInList();
private:
    CState*					    currentState;
    CStateCollection *			stateCollection;
    CStateMachineDelegate*		delegate;
};

} /* namespace GGE */
#endif /* CGAMESTATEMACHINE_H_ */
